import NumberView from "./NumberView";
// import httpUtils from "./XmlHttpTool";
import PlatformUtil from "./PlatformUtil";

cc.Class({
    extends: cc.Component,

    properties: {
        numberCompontent:NumberView,
        chargeBtn:cc.Node,
        shopBtn:cc.Node,
        shopScrollView:cc.Node,
        backBtn:cc.Button
    },

 

    onLoad () {

        // var that= this
        // httpUtils.NhttpPost("/users/stars",{},function(res){
     
        //  var stars =parseInt(res["stars"])
       
        //  that.numberCompontent.setText(stars)
   
        // },function(failres){

        //  console.log('刷新金币错误',failres)
        
        // })
    },


    gotoShopClick:function(){

        console.log("进入商城")

        var changebig2 = cc.scaleTo(0.2,1.1);

        var finish = cc.callFunc(function(){
    
          var changesmail2 = cc.scaleTo(0.1,1.0);
          this.shopBtn.runAction(changesmail2)
    
       }, this);
    
       var seq = cc.sequence(changebig2,finish)
    
        this.shopBtn.runAction(seq)

        this.shopScrollView.active=true

    },


    rechargeClick:function(){

        var changebig2 = cc.scaleTo(0.2,1.1);

        var finish = cc.callFunc(function(){
    
          var changesmail2 = cc.scaleTo(0.1,1.0);
          this.chargeBtn.runAction(changesmail2)
    
       }, this);
    
       var seq = cc.sequence(changebig2,finish)
    
        this.chargeBtn.runAction(seq)
        
       console.log("去充值")

       PlatformUtil.platform.exchangeStar()
    

    },


    backmainClick:function(){
        PlatformUtil.platform.exit();
    },
    
    start () {

    },


});
